{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "bdafe5b0-6c23-49ed-a4c4-db0f556d6c44",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix\n",
    "\n",
    "\n",
    "Runtime: 32 ms, faster than 66.11% of C++ online submissions for Kth Smallest Element in a Sorted Matrix.\n",
    "Memory Usage: 15.3 MB, less than 11.31% of C++ online submissions for Kth Smallest Element in a Sorted Matrix.\n",
    "\n",
    "\n",
    "```cpp\n",
    "#include<bits/stdc++.h> \n",
    "\n",
    "using namespace std;\n",
    "\n",
    "class Solution {\n",
    "public:\n",
    "    int kthSmallest(vector<vector<int>>& matrix, int k) {\n",
    "        //3:44\n",
    "        vector<int> nums;\n",
    "        for (auto row: matrix) {\n",
    "            for (int num : row) {\n",
    "                nums.push_back(num);\n",
    "            }\n",
    "        }\n",
    "        sort(nums.begin(), nums.end());\n",
    "        return nums[k-1];\n",
    "        //3:44\n",
    "    }\n",
    "};\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1ddb75f6-b3f0-4996-ad9f-a5008fd21d42",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++17",
   "language": "C++17",
   "name": "xcpp17"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
